package com.cryann.mqttserver.service;

import com.cryann.mqttserver.modle.Accessor;
import com.cryann.mqttserver.modle.MqttSendMessage;
import io.netty.channel.Channel;
import io.netty.handler.codec.mqtt.MqttConnectMessage;

import java.util.List;
import java.util.Set;


/**
 * @author cRyann
 * @date 2018/12/20 0020 10:06
 * @description:
 */
public interface MqttAccessor {

    boolean sendMsg(MqttSendMessage mqttMessage);

    boolean addAccessor(Channel channel, MqttConnectMessage message);

    boolean delAccessor(Channel channel);

    Accessor getAccessor(Accessor accessor);

    Accessor getAccessor(Channel channel);

    Set<Channel> getAccessor(String topicName);

    List<Accessor> getTopicNames(String topicFromMsg);

    Accessor subTopic(Accessor accessor, String topic);

    Accessor unSubTopic(Accessor accessor, List<String> topics);

    Accessor getAccessorByUserName(String userName);

    void updateAccessorByChannel(Channel channel);

    void willMessageSend(String identifier);

}
